/**
 * 管理后台首页相关JS
 * author: zhanghua 2015-9-9
 */
$(function(){
	$('#btnPersonalSet').click(function () {
		var nickname = $("#nickname").val();
		var sign = $("#sign").val();
		var img = $("#imgval").val();
		var realname = $("#realname").val();
		var email = $("#email").val();

		if(nickname == null || nickname == ''){
			alert('会玩号名称不能为空')
			return false;
		}
		if(sign == null || sign == ''){
			alert('会玩号介绍不能为空')
			return false;
		}
		if(img == null || img == ''){
			alert('会玩号头像不能为空')
			return false;
		}

		if(realname == null || realname == ''){
			alert('联系人不能为空')
			return false;
		}

		if(email == null || email == ''){
			alert('联系邮箱不能为空')
			return false;
		}

		var data = {
			"nickname": nickname,
			"sign" : sign,
			"img" : img,
			"realname" : realname,
			"email" : email,
		};
		var postUrl = $('#postPersonalSetUrl').val()

		post_json(postUrl, data ,function(res){
			switch(res.status){
				case 1:
					location.reload();
					break;
				case 0:
					alert(res.msg);
					break;
			}
		});
		return false;
	});
});


